package net.opentsdb.query.filter.value;

import java.util.ArrayList;
import java.util.List;

public class AndExpr extends NumericExpression {

    private List<NumericExpression> items = new ArrayList<NumericExpression>();
    public AndExpr(){

    }

    public void addExpression(NumericExpression expression){
        items.add(expression);
    }

    @Override
    public boolean evaluate(Number theValue) {
        for (NumericExpression item : items) {
            if( !item.evaluate(theValue))
                return false;
        }
        return true;
    }
}
